home *** CD-ROM | disk | FTP | other *** search
- /* file: FYAH.c
- puts up a fake dissassembly, similar to Arnold's Terminator special effects.
- the acronym comes from the famous line, which is not allowable in a family environment
- By MGD
- */
-
- #include "busybox.h"
-
- #define numStrings 20
- #define stringID 401
- #define lineSlew 12
- static Rect yourRect;
- Str255 strangs[numStrings];
- static int16 lastVert;
- static int16 bottom;
-
- #define abs(x) ((x <= 0) ? (-x) : (x))
-
- void InitFYAHObj(Rect *drawArea, int16 ID) {
- int16 i;
-
- yourRect = *drawArea;
- for (i = 0; i < numStrings; i++) {
- GetIndString(&strangs[i], stringID, i+1);
- }
- lastVert = 0;
- bottom = yourRect.bottom;
-
- OffsetRect(&yourRect, yourRect.left, yourRect.top);
- SetRect(&yourRect, 0, 0, 500, 500); /* kludge */
-
- } /* InitRandomDotObj */
-
-
-
- void DrawFYAHObj(int16 ID) {
- int16 z,x;
- RgnHandle tempRgn;
-
- if (Random() > 10000) return;
-
- TextSize(9);
- tempRgn = NewRgn();
-
- if ((lastVert + lineSlew) > bottom) {
- /* scroll */
- ScrollRect(&yourRect, 0, -lineSlew, tempRgn);
- EraseRgn(tempRgn);
- DisposeRgn(tempRgn);
- lastVert -= lineSlew;
- }
- lastVert += lineSlew;
- MoveTo(3,lastVert);
- z = Random();
- x = abs(z) % numStrings;
- DrawString(strangs[x]);
- } /* DrawRandomDotObj */
-
-
-
-